package com.region.http.client.config;

import com.region.http.client.common.ContentType;
import com.region.http.client.common.RequestType;

/**
 * @author liujieyu
 * @date 2023/7/8 21:15
 * @description
 */
public class RequestAnnotationConfig {

    private RequestType requestType;

    private ContentType contentType;

    private int connectTime;

    private int readTime;

    private int requestTime;

    private RequestAnnotationConfig(RequestType requestType, ContentType contentType, int connectTime, int readTime, int requestTime) {
        this.requestType = requestType;
        this.contentType = contentType;
        this.connectTime = connectTime;
        this.readTime = readTime;
        this.requestTime = requestTime;
    }

    public RequestType getRequestType() {
        return requestType;
    }

    public void setRequestType(RequestType requestType) {
        this.requestType = requestType;
    }

    public ContentType getContentType() {
        return contentType;
    }

    public void setContentType(ContentType contentType) {
        this.contentType = contentType;
    }

    public int getConnectTime() {
        return connectTime;
    }

    public void setConnectTime(int connectTime) {
        this.connectTime = connectTime;
    }

    public int getReadTime() {
        return readTime;
    }

    public void setReadTime(int readTime) {
        this.readTime = readTime;
    }

    public int getRequestTime() {
        return requestTime;
    }

    public void setRequestTime(int requestTime) {
        this.requestTime = requestTime;
    }

    public static RequestAnnotationConfigBuilder builder() {
        return new RequestAnnotationConfigBuilder();
    }

    public static final class RequestAnnotationConfigBuilder {

        private RequestType requestType;

        private ContentType contentType;

        private int connectTime;

        private int readTime;

        private int requestTime;

        private RequestAnnotationConfigBuilder() {
        }


        public RequestAnnotationConfigBuilder requestType(RequestType requestType) {
            this.requestType = requestType;
            return this;
        }

        public RequestAnnotationConfigBuilder contentType(ContentType contentType) {
            this.contentType = contentType;
            return this;
        }

        public RequestAnnotationConfigBuilder connectTime(int connectTime) {
            this.connectTime = connectTime;
            return this;
        }

        public RequestAnnotationConfigBuilder readTime(int readTime) {
            this.readTime = readTime;
            return this;
        }

        public RequestAnnotationConfigBuilder requestTime(int requestTime) {
            this.requestTime = requestTime;
            return this;
        }

        public RequestAnnotationConfig build() {
            return new RequestAnnotationConfig(requestType, contentType, connectTime, readTime, requestTime);
        }
    }
}
